import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);
const home = () => import("../views/home/home");
const categroy = () => import("../views/categroy/categroy");
const cart = () => import("../views/cart/cart");
const my = () => import("../views/my/my");
const detail = () => import("../views/detail/detail.vue");

const routes = [
  {
    path: "",
    redirect: "/home",
  },
  {
    path: "/home",
    component: home,
  },
  {
    path: "/categroy",
    component: categroy,
  },
  {
    path: "/cart",
    component: cart,
  },
  {
    path: "/my",
    component: my,
  },
  {
    path: "/detail/:iid",
    component: detail,
  },
];
const router = new Router({
  routes,
  mode: "history",
});
export default router;
